home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Texto y fuentes / HuckleberryFinnHalfHeight / HuckleberryFinnHalfHeight.cs next >
Encoding:
Text File  |  2002-05-03  |  1.8 KB  |  49 lines

  1. //--------------------------------------------------------
  2. // HuckleberryFinnHalfHeight.cs ⌐ 2001 by Charles Petzold
  3. //--------------------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class HuckleberryFinnHalfHeight: Form
  9. {
  10.      public static void Main()
  11.      {
  12.           Application.Run(new HuckleberryFinnHalfHeight());
  13.      }
  14.      public HuckleberryFinnHalfHeight()
  15.      {
  16.           Text = "\"Las aventuras de Huckleberry Finn\"";
  17.           BackColor = SystemColors.Window;
  18.           ForeColor = SystemColors.WindowText;
  19.           ResizeRedraw = true;
  20.      }
  21.      protected override void OnPaint(PaintEventArgs pea)
  22.      {
  23.           Graphics  grfx = pea.Graphics;
  24.           int       cx   = ClientSize.Width;
  25.           int       cy   = ClientSize.Height;
  26.           Pen       pen  = new Pen(ForeColor);
  27.           Rectangle rect = new Rectangle(0, 0, cx / 2, cy / 2);
  28.  
  29.           grfx.DrawString(     
  30.               "No sabrΘis quiΘn soy yo si no habΘis leφdo " +
  31.               "un libro titulado \"Las aventuras de Tom " +
  32.               "Sawyer\", pero no importa. Ese libro lo " +
  33.               "escribi≤ el se±or Mark Twain y cont≤ la " +
  34.               "verdad, casi siempre. Algunas cosas las " +
  35.               "exager≤, pero casi siempre dijo la verdad. " +
  36.               "Eso no es nada. Nunca he visto a nadie que " +
  37.               "no mintiese alguna vez, menos la tφa Polly, " +
  38.               "o la viuda, o quizß Mary. De la tφa " +
  39.               "Polly\x2014es la tφa Polly de Tom\x2014y de " +
  40.               "Mary y de la viuda Douglas se cuenta todo en " +
  41.               "ese libro, que es verdad en casi todo, con " +
  42.               "algunas exageraciones, como he dicho antes.", 
  43.                Font, new SolidBrush(ForeColor), rect);
  44.  
  45.           grfx.DrawLine(pen, 0,      cy / 2, cx / 2, cy / 2);
  46.           grfx.DrawLine(pen, cx / 2, 0,      cx / 2, cy / 2);
  47.      }
  48. }
  49.